#! /bin/bash
#
# This script will run some other scripts to generate reports.
#
# @later	find a decent way to run multiple processes at once (maybe use `wait`)
# @version	1.0.0
# @author	Tijs Verkoyen <tijs@sumocoders.be>

# create folder
mkdir -p reports

# tell user
echo "* Running PHP Mess Detection (will take a while)"

# run PHP Mess Detection
phpmd ../ xml codesize,unusedcode,naming --exclude ../backend/core/js/ckeditor,../backend/core/js/ckfinder,../frontend/cache,../backend/cache,../install/cache,../tools,../library/external --reportfile ./reports/phpmd.xml

# tell user
echo "* Running PHP Depend (will take a while)"

# run PHP Depend
pdepend --jdepend-chart=./reports/pdepend_chart.svg --overview-pyramid=./reports/pdepend_pyramid.svg --summary-xml=./reports/pdepend.xml --suffix=php --ignore=../backend/core/js/ckeditor,../backend/core/js/ckfinder,../frontend/cache,../backend/cache,../install/cache,../tools,../library/external ../ > /dev/null

# tell user
echo "* Running PHP Loc"

# run PHP Loc
phploc --log-xml ./reports/phploc.xml --suffixes php ../ > /dev/null

# tell user
echo "Done"
